package com.ylong;

import com.ylong.dto.Source;
import com.ylong.entity.Course;
import com.ylong.entity.GenderEnum;
import com.ylong.entity.Student;
import com.ylong.entity.Target;
import com.ylong.mapper.SourceTargetMapper;
import com.ylong.mapper.StudentMapper;
import com.ylong.vo.StudentVO;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

/**
 * Main:${DESCRIPTION}
 *
 * @author: zhaoyl
 * @date: 2020/12/10
 */
public class Main {

    public static void main(String[] args) {
//        Source s = new Source();
//        s.setTest("5");
//        s.setTest1("51");
//
//        Target t = SourceTargetMapper.MAPPER.toTarget(s);
//        System.out.println(t);

        Student student = Student.builder().name("小明").age(6).gender(GenderEnum.Male).height(121.1).birthday(new Date()).build();
//        System.out.println(student);
//        //这行代码便是实际要用的代码
//        StudentVO studentVO = StudentMapper.INSTANCE.student2StudentVO(student);
//        System.out.println(studentVO);

        List<Student> list = new ArrayList<>();
        list.add(student);
        List<StudentVO> result = StudentMapper.INSTANCE.students2StudentVOs(list);
        System.out.println(result);

        Course course = Course.builder().id(1L).courseName("语文").sortNo(123).build();
        StudentVO studentVO = StudentMapper.INSTANCE.studentAndCourse2StudentVO(student, course);
        System.out.println(studentVO);
    }
}
